
import com.jme3.asset.AssetManager;
import com.jme3.audio.AudioRenderer;
import com.jme3.input.InputManager;
import com.jme3.niftygui.NiftyJmeDisplay;
import com.jme3.renderer.ViewPort;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;

/**
 *
 * @author David Zhang
 */
public class Gui implements ScreenController{
    public static Nifty nifty;
    public static NiftyJmeDisplay niftyDisplay;
    
    public Gui(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer, ViewPort guiViewPort){
        niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort);
        nifty = niftyDisplay.getNifty();
        nifty.fromXml("Interface/GUI.xml", "start", this);
        guiViewPort.addProcessor(niftyDisplay);
    }
    
    public static void changeScreen(String name){
        nifty.gotoScreen(name);
    }
    
    public void returnMain(){
        changeScreen("start");
    }

    @Override public void bind(Nifty nifty, Screen screen) {}
    @Override public void onStartScreen() {}
    @Override public void onEndScreen() {}
}